package ml.kupin.controller;

import ml.kupin.search.service.IndexItemService;
import ml.kupin.common.utils.KuPinResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 商品索引库维护Controller
 * Created by 小柯(Allen Kerr) on 17.5.2 20:41.
 */
@Controller
@RequestMapping("/index/item")
public class IndexItemController {

    @Autowired
    private IndexItemService indexItemService;

    @RequestMapping(value = "/import", method = RequestMethod.POST)
    @ResponseBody
    public KuPinResult importItems2Solr() {
        KuPinResult kuPinResult = indexItemService.importAllItems();
        return kuPinResult;
    }

}
